package com.fanfanwang.ffw.app.net;

import java.util.HashMap;
import java.util.LinkedHashMap;

import org.ksoap2.serialization.SoapObject;

import android.content.Context;
import android.widget.Toast;

import com.fanfanwang.ffw.app.common.LogUtil;

public class XSHttpService {
	/**
	 * 需要异步操作
	 * @author xfchen
	 * @date 2014-9-18下午6:47:03
	 * @todo TODO
	 * @param 
	 * @return
	 */
	public String requestSms(String methodName,LinkedHashMap<String, Object> paramsMap){
		SoapObject soapOjbect = WebServiceHelper.getSoapObject(WebServiceHelper.url_users,methodName, null, paramsMap);
		if(null == soapOjbect){
			return "{status\":0,\"msg\":\"\"}";
		}
		LogUtil.e("XSHttpService", "request  ", soapOjbect.getPropertyAsString(0));
		String str = soapOjbect.getPropertyAsString(0);
		return str;
	}
	/**
	 * 需要异步操作,登陆
	 * @author lyf
	 * @date 2015-3-2下午2:03
	 * @todo TODO
	 * @param 
	 * @return
	 */
	public String requestLogin(String methodName,LinkedHashMap<String, Object> paramsMap){
		SoapObject soapOjbect = WebServiceHelper.getSoapObject(WebServiceHelper.url_users,methodName, null, paramsMap);
		if(null == soapOjbect){
			return "{status\":0,\"msg\":\"\"}";
		}
		LogUtil.e("XSHttpService", "request  soapOjbect >> " + soapOjbect);
		LogUtil.e("XSHttpService", "request   >> " + soapOjbect.getPropertyAsString(0));
		String str = soapOjbect.getPropertyAsString(0);
		return str;
	}
	/**
	 *检测用户是否已经注册
	 * @author lyf
	 * @date 2015-3-2下午2:03
	 * @todo TODO
	 * @param 
	 * @return
	 */
	public String requestParkIsReg(String methodName,LinkedHashMap<String, Object> paramsMap){
		SoapObject soapOjbect = WebServiceHelper.getSoapObject(WebServiceHelper.url_users,methodName, null, paramsMap);
		if(null == soapOjbect){
			return "{status\":0,\"msg\":\"\"}";
		}
		LogUtil.e("XSHttpService", "request  soapOjbect >> " + soapOjbect);
		LogUtil.e("XSHttpService", "request   >> " + soapOjbect.getPropertyAsString(0));
		String str = soapOjbect.getPropertyAsString(0);
		return str;
	}
	/**
	 *设置商户密码
	 * @author lyf
	 * @date 2015-3-2下午2:03
	 * @todo TODO
	 * @param 
	 * @returniii.	setparkNewPassword
	 */
	public String requestSetParkNewPassword(String methodName,LinkedHashMap<String, Object> paramsMap){
		SoapObject soapOjbect = WebServiceHelper.getSoapObject(WebServiceHelper.url_users,methodName, null, paramsMap);
		if(null == soapOjbect){
			return "{status\":0,\"msg\":\"\"}";
		}
		LogUtil.e("XSHttpService", "request  soapOjbect >> " + soapOjbect);
		LogUtil.e("XSHttpService", "request   >> " + soapOjbect.getPropertyAsString(0));
		String str = soapOjbect.getPropertyAsString(0);
		return str;
	}
	/**
	 * 	首页模块 获取停车位列表
	 * @param methodName
	 * @param paramsMap
	 * @return
	 */
	public String requestParking(String methodName,LinkedHashMap<String, Object> paramsMap){
		SoapObject soapOjbect = WebServiceHelper.getSoapObject(WebServiceHelper.url_parkings,methodName, null, paramsMap);
		if(null == soapOjbect){
			return "{status\":0,\"msg\":\"\"}";
		}
		LogUtil.e("XSHttpService", "request   >> " + soapOjbect.getPropertyAsString(0));
		String str = soapOjbect.getPropertyAsString(0);
		return str;
	}
	/**
	 * 	首页模块 添加停车位
	 * @param methodName
	 * @param paramsMap
	 * @return
	 */
	public String addParknum(String methodName,LinkedHashMap<String, Object> paramsMap){
		SoapObject soapOjbect = WebServiceHelper.getSoapObject(WebServiceHelper.url_parkings,methodName, null, paramsMap);
		if(null == soapOjbect){
			return "{status\":0,\"msg\":\"\"}";
		}
		LogUtil.e("XSHttpService", "request   >> " + soapOjbect.getPropertyAsString(0));
		String str = soapOjbect.getPropertyAsString(0);
		return str;
	}
	/**
	 * 	首页模块 删除停车位
	 * @param methodName
	 * @param paramsMap
	 * @return
	 */
	public String delParknum(String methodName,LinkedHashMap<String, Object> paramsMap){
		SoapObject soapOjbect = WebServiceHelper.getSoapObject(WebServiceHelper.url_parkings,methodName, null, paramsMap);
		if(null == soapOjbect){
			return "{status\":0,\"msg\":\"\"}";
		}
		LogUtil.e("XSHttpService", "request   >> " + soapOjbect.getPropertyAsString(0));
		String str = soapOjbect.getPropertyAsString(0);
		return str;
	}
	/**
	 * 	首页模块 设置停车位状态
	 * @param methodName
	 * @param paramsMap
	 * @return
	 */
	public String setParknumStatus(String methodName,LinkedHashMap<String, Object> paramsMap){
		SoapObject soapOjbect = WebServiceHelper.getSoapObject(WebServiceHelper.url_parkings,methodName, null, paramsMap);
		if(null == soapOjbect){
			return "{status\":0,\"msg\":\"\"}";
		}
		LogUtil.e("XSHttpService", "request   >> " + soapOjbect.getPropertyAsString(0));
		String str = soapOjbect.getPropertyAsString(0);
		return str;
	}
	/**
	 * i.	getMsgList获取预约消息
	 * @param methodName
	 * @param paramsMap
	 * @return
	 */
	public String getMsgList(String methodName,LinkedHashMap<String, Object> paramsMap){
		SoapObject soapOjbect = WebServiceHelper.getSoapObject(WebServiceHelper.url_parkings,methodName, null, paramsMap);
		if(null == soapOjbect){
			return "{status\":0,\"msg\":\"\"}";
		}
		LogUtil.e("XSHttpService", "request   >> " + soapOjbect.getPropertyAsString(0));
		String str = soapOjbect.getPropertyAsString(0);
		return str;
	}
}
